Skip to content

Conversation

@jaclync
Copy link
Contributor

@jaclync jaclync commented Sep 8, 2025

Closes WOOMOB-1297

Summary

This PR introduces POSCatalogIncrementalSyncService for incremental sync by only fetching products and variations modified since the last full/incremental sync. Only the remote sync is implemented in this PR, persistence is in #16106 to make reviews easier.

Key Changes

  • POSCatalogIncrementalSyncService: New service implementing incremental sync logic with per-site sync date tracking. The last incremental sync date will be persisted in a future task WOOMOB-1289
  • BatchedRequestLoader: Generic utility extracted from existing sync services for reusable paginated data loading

Steps to reproduce

Just CI is sufficient, as the full/incremental services aren't integrated with the app yet.

Testing information

I tested that full sync worked as before, and incremental sync worked after a full sync for a big site:

Task {
   do {
        let date = Date()
        let catalog = try await syncService.startFullSync(for: siteID)
        print("Full sync completed with \(catalog.products.count) products and \(catalog.variations.count) variations for siteID \(siteID)")

        try await incrementalSyncService.startIncrementalSync(for: siteID, lastFullSyncDate: date)
        print("Incremental sync completed")
    } catch {
        print("Full sync failed for siteID \(siteID) with error: \(error)")
    }
}

If the full sync integration is merged, I will test the incremental sync with debug code after full sync integration is in trunk.


  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

@jaclync jaclync added type: task An internally driven task. feature: POS labels Sep 8, 2025
@jaclync jaclync added this to the 23.3 milestone Sep 8, 2025
@jaclync jaclync changed the title Add POSCatalogIncrementalSyncService for efficient catalog updates [Local Catalog] Sync and persist incremental products/variations to database Sep 8, 2025
@jaclync jaclync changed the title [Local Catalog] Sync and persist incremental products/variations to database [Local Catalog] Sync and persist incrementally changed products/variations to database Sep 8, 2025
@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Sep 8, 2025

App Icon📲 You can test the changes from this Pull Request in WooCommerce iOS Prototype by scanning the QR code below to install the corresponding build.

App NameWooCommerce iOS Prototype
Build Numberpr16102-1dd2103
Version23.2
Bundle IDcom.automattic.alpha.woocommerce
Commit1dd2103
Installation URL00a6ug6jg0tvg
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

siteID: siteID,
path: path,
parameters: parameters,
availableAsRESTRequest: true
Copy link
Contributor Author

@jaclync jaclync Sep 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding availableAsRESTRequest: true as an oversight from the previous remote implementation.

@jaclync jaclync requested a review from joshheald September 8, 2025 13:23
@jaclync jaclync changed the title [Local Catalog] Sync and persist incrementally changed products/variations to database [Local Catalog] Incremental sync: remote sync Sep 9, 2025
Copy link
Contributor

@joshheald joshheald left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, works well

@jaclync
Copy link
Contributor Author

jaclync commented Sep 10, 2025

Tested full sync integration with the latest trunk, merging now.

@jaclync jaclync merged commit 042569a into trunk Sep 10, 2025
18 checks passed
@jaclync jaclync deleted the feat/WOOMOB-1097-incremental-sync-service branch September 10, 2025 03:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature: POS type: task An internally driven task.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants